<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="row">
	<div class="col-sm-9">
		<h4>Empresas  <small>({{results.totalItems}} resultados)</small></h4>
		<ul class="list-group">
			<li class="list-group-item" ng-repeat="company in results.results">
				<div>
					<a href="#/companies/id/{{company.id}}">{{company.name}}</a>
				</div>
			</li>
		</ul>
		<div class="pull-right">
			<a href="#companies/new">Nueva empresa</a>
		</div>
		<pagination total-items="results.totalItems" page="results.currentPage" items-per-page="results.itemsPerPage" on-select-page="setPage(page)"></pagination>
	</div>
	<div class="col-sm-3">
		<div>
			<h4>Filtrar resultados</h4>
			<form role="form">
				<div class="form-group">
					<label>Nombre</label>
					<input type='text' class="form-control input-sm" ng-model="searchName" placeholder="Nombre"/>
				</div>
				<div class="form-group">
					<label for="entityIdCardNumber">Provincia</label>
					<input type='text' class="form-control input-sm" ng-model="searchProvince" placeholder="Provincia" typeahead="province as province.name for province in provinces($viewValue)" />
				</div>
				<button ng-click="search()" class='btn btn-primary btn-sm '>Buscar</button></li>
			</form>
		</div>
		<!-- popup con el json de debug -->
		<div class="m-top-40">
			<button class="btn btn-default btn-sm" data-toggle="modal" data-target="#debugJson">Ver JSON</button>
			<div class="modal fade" id="debugJson" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
				<div class="modal-dialog">
					<div class="modal-content">
						<pre>entity = {{results | json}}</pre>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
</body>
</html>